Unit ItemProperties;

{$mode objfpc}{$H+}

Interface

Uses
  Crt,
  Initializer,
  Abilities,
  DefaultClasses,
  MenuDraw,
  EnA;

Procedure ItemLesserPotion(Var Health : Integer);
Procedure ItemManaPotion(Var Mana : Integer);
Procedure ItemPotion(Var Health : Integer);
Procedure ItemGreaterPotion(Var Health : Integer);
Procedure ItemAntidote(Var Ailment1, Ailment2 : String);
Procedure ItemProteinShake(Var DamageBoost : Integer);
Procedure ItemDiazepam(Var DamageBoost : Integer);
Procedure ItemTonic(Var DamageBoost : Integer);
Procedure ItemXpBoost(Var xpBoost : Integer);

Implementation

//1
Procedure ItemLesserPotion(Var Health : Integer);
Var AmountHealed : Integer;
  Begin
    AmountHealed := Random(30) + 30;
    Health := Health + AmountHealed;
    If Health > HP then
      Health := HP;
    Attention_NoClear;
    DItem[1].ItemAmount := DItem[1].ItemAmount - 1;
  end;

//2
Procedure ItemManaPotion(Var Mana : Integer);
Var AmountHealed : Integer;
  Begin
    AmountHealed := Random(50) + 30;
    Mana := Mana + AmountHealed;
    If Mana > MP then
      Mana := MP;
    Attention_NoClear;
    DItem[2].ItemAmount := DItem[2].ItemAmount - 1;
  end;

//3
Procedure ItemPotion(Var Health : Integer);
Var AmountHealed : Integer;
  Begin
    AmountHealed := Random(70) + 70;
    Health := Health + AmountHealed;
    If Health > HP then
      Health := HP;
    Attention_NoClear;
    DItem[3].ItemAmount := DItem[3].ItemAmount - 1;
  end;

//4
Procedure ItemGreaterPotion(Var Health : Integer);
Var AmountHealed : Integer;
  Begin
    AmountHealed := + Random(100) + 150;
    Health := Health + AmountHealed;
    If Health > HP then
      Health := HP;
    Attention_NoClear;
    DItem[4].ItemAmount := DItem[4].ItemAmount - 1;
  end;

//5
Procedure ItemAntidote(Var Ailment1, Ailment2 : String);
  Begin
    If Ailment1 = 'Poison' then
      Ailment1 := '';

    If Ailment2 = 'Poison' then
      Ailment2 := '';

    Writeln('Poison cured!');
    Attention_noclear;
    DItem[5].ItemAmount := DItem[5].ItemAmount - 1;
  end;

//6
Procedure ItemProteinShake(Var DamageBoost : Integer);
  Begin
    DamageBoost := 10;
    Writeln('You feel slightly stronger');
    Attention_noclear;
    DItem[6].ItemAmount := DItem[6].ItemAmount - 1;
  end;

//7
Procedure ItemDiazepam(Var DamageBoost : Integer);
  Begin
    DamageBoost := 10;
    Writeln('You feel your reflexed heighten');
    Attention_noclear;
    DItem[7].ItemAmount := DItem[7].ItemAmount - 1;
  end;

//8
Procedure ItemTonic(Var DamageBoost : Integer);
  Begin
    DamageBoost := 10;
    Writeln('You feel magic flow through your veins');
    Attention_noclear;
    DItem[8].ItemAmount := DItem[8].ItemAmount - 1;
  end;

//9
Procedure ItemXpBoost(Var xpBoost : Integer);
 Begin
   XpBoost := 10;
   DItem[9].ItemAmount := DItem[9].ItemAmount - 1;
 end;



end.

